<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			// #ifdef APP
			plus.camera.getCamera()
			// #endif
			this.$socketTask.onOpen((res) => {
				console.log('WebSocket连接打开', res);
				this.$socketTask.send({
					data: JSON.stringify({
						code: 'joinRoom',
						data: '3232'
					})
				})
			});
			this.$socketTask.onMessage((res) => {
				console.log('3333','res',res);
				// this.socketEmit(res.data)
				// 在这里处理接收到的消息
			});
			this.$socketTask.onError((err) => {
				console.error('WebSocket错误：', err);
			});
			this.$socketTask.onClose((res) => {
				console.log('WebSocket连接关闭', res);
			});
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	::-webkit-scrollbar {
	  width: 0;
	  height: 0;
	  color: transparent;
	}
	*{
		font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
	}
	pre {
		margin: 30rpx;
		background-color: #f2f2f2;
		border-radius: 15rpx;
		padding: 30rpx;
		overflow-y: scroll;
	}
	/*每个页面公共css */
</style>
